function displayDirectory(directory){
	var id = directory;
	var xhr;

	if (window.XMLHttpRequest){
		xhr = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		xhr = new ActiveXObject('Microsoft.XMLHTTP');
	}else{
		alert('JavaScript : votre navigateur ne supporte pas les objets XMLHttpRequest...');
		return;
	}

	xhr.open('POST', 'application/controller/displayDirectoryController.php', true);
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4){
			if(document.getElementById){
				document.getElementById(id).innerHTML =
					'<li id="'+id+'">'+
						'<img src="./public/image/folder.gif"> '+
						'<a href="#'+id+'" onClick="javascript:undisplayDirectory(\''+id+'\');">'+
							id+
						'</a>'+
					'</li>'
				;
				document.getElementById(id).innerHTML += xhr.responseText;
			}
		}
	}

	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	var data = 'directory='+escape(directory);
	xhr.send(data);
}

function undisplayDirectory(directory){
	var id = directory;

	if(document.getElementById){
		document.getElementById(id).innerHTML =
			'<li id="'+id+'">'+
				'<img src="./public/image/folder.gif"> '+
				'<a href="#'+id+'" onClick="javascript:displayDirectory(\''+id+'\');">'+
					id+
				'</a>'+
			'</li>'
		;
	}
}